import Vue from 'vue'
import Vuex from 'vuex'
import modulesCart from '@/store/cart.js'
import modulesUser from '@/store/user.js'

// 注册Vuex到vue中
Vue.use(Vuex)
// 创建store对象
const store = new Vuex.Store({
  // 挂载store模块
  modules: {
    // 挂载购物车的vuex模块，模块内成员的访问路径为m_cart
    "m_cart": modulesCart,
    "m_user": modulesUser
  }
})

export default store